The present invention relates generally to computer systems and more particularly to a platform independent memory image analysis architecture for debugging a computer program.
The debugging of a computer program generally entails manipulating data in a memory image file that contains a snapshot of the memory used by the computer program. The memory image file may be generated either during execution of the computer program or at the time of failure of the computer program. A memory image file generated during execution is known as a xe2x80x9crun time dump,xe2x80x9d whereas a memory image file generated at the time of failure is known as a xe2x80x9ccrash dumpxe2x80x9d or a xe2x80x9cpost-mortem dump.xe2x80x9d
In order to properly analyze a memory image file, one must appreciate the data types of the data contained within the memory image file. Definitions of the data types are contained within the source code of the computer program. When a party seeks to decode the memory image file manually, the party examines the source code looking for data type definitions within the source code. The party then applies the discovered data type definitions to interpret the data in the memory image file. The party may instead use general application automated debugging programs to assist in analyzing the data in the memory image file. The debugging program reads data type definitions from debug tables that were built by a compiler when the computer program was compiled.
Parties may also use custom tools to help examine the memory image file. These custom tools are typically custom built to examine a particular variety of memory image file. For example, such custom automated tools may be customized to examine memory image files for a particular instance of an operating systems (e.g. a given version of an operating system running on a particular hardware platform).
One difficulty with conventional tools concerns the static nature of data type definitions. Data type definitions are often static in that they are tied to a particular platform, operating system version, patch or patch version. For example, the integer (xe2x80x9cintxe2x80x9d) data type may be designated as a signed 16 bit value defined for a first hardware platform, a signed 32 bit data type when defined for a second hardware platform and a signed 64 bit data type when defined for a third hardware platform. Each data type representation is statically written into the program source file and statically encoded into the debug tables that are produced by the compiler when compiling the program source file.
Automated debugging tools are built to understand and interpret memory image files for a particular hardware platform and a particular version of an operating system with a particular set of patches. As a result, automated debugging tools cannot be used on multiple hardware platforms, with multiple versions of the operating system or with multiple instances of the operating system containing different patches. Hence, separate automated debugging tools must be provided for each combination of hardware platform, operating system version and patch.
The present invention addresses the above-described limitations of conventional memory image file analysis tools. The present invention provides an analysis architecture that is platform independent (i.e. not statically dependent on an underlying platform), not tied to a particular version of a program and not dependent on the presence or absence of patches. The analysis architecture dynamically determines data type definitions to account for the hardware architecture on which the program runs, for the version of the program that is running and for the presence or absence of patches. The data type definitions may be fully resolved at the time in which a request is made to view a given data structure or object within the memory image file. The present invention also facilitates the ability to symbolically access data to enhance the ease with which the data in the memory image file may be accessed.
In accordance with one aspect of the present invention, a computing environment includes tools for accessing data in memory images. A first program source defines a data type to have a first set of characteristics (e.g. size, alignment, etc.). A first memory image is produced for the first program source. A second program source also defines the data type but defines the data type to have a second set of characteristics that differ from the first set of characteristics. A second memory image is provided for the second program source. An analysis tool is used to dynamically determine the first set of characteristics of the data type. The analysis tool employs knowledge of the first set of characteristics and accesses data of the data type of the first program source. The same analysis tool dynamically determines the second set for characteristics of the data type and employs knowledge of the second set of characteristics to access data in the second program source. The first program source and the second program source may be computer programs, such as operating systems or even different versions of a common operating system. The first program source and the second program source may differ as to whether they include a given patch or not. Thus, the analysis tool is not statically tied to a single program source by rather may be used with multiple program sources.
A computer program may be processed, such as by passing the computer program through a compiler, to identify computer system independent attributes of a selected data type defined within the computer program. These attributes may include attributes that are not tied to the computer platform on which the program runs. The computer system independent attributes are stored in a template. The template is subsequently used in accessing data in the memory image of the selected data type. The template encapsulates the computer system independent attributes. The template may be used to overcome the limitations of static data type definitions by providing a characterization of the data type that has no computer system dependencies. Hence, the image analysis tool does not fail or falter by encountering data in a format different from what is expected.
In accordance with another aspect of the present invention, a program operation context is provided to hold information regarding a context in which a computer program runs on a computer system. An analysis facility identifies information on a program operation context that influences attributes of a data type that is defined within the computer program. The analysis facility creates a view of the data type based on the information that is identified and employs the view in analyzing a memory image for the computer program. Thus, the analysis facility is adaptable to account for dependencies that are particular to the computer program instance being run and the platform on which the computer program is being run. As a result, the analysis facility can be used on different platforms and with different computer program instances without fearing problems caused by computer system dependencies.
In accordance with a further aspect of the present invention, a memory image is provided to hold data from a computer program that runs on a computer system. A computer program is processed to extract attributes of a selected data type that are independent of a program operation context for the computer program. The extracted attributes are stored in the template and the attributes of the template are used to create a data type object for holding information regarding a selected data type. The data type object is completed using information that is dependent on the program operation context. The data type object is then used in accessing data in the selected data type in the memory image file. In particular, the data type object may be used to generate a data object that identifies the data of the selected data type from the memory image file. In this fashion, the attributes of the selected data type that are dependent on the program operation context and the attributes of the selected data type that are independent of the program operation context are taken into account. The characterization of the selected data type is ensured to be accurate.
It should be appreciated that the data type objects need not be created from the templates but rather may be separately created.